package com.augurit.common.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 组织对象角色关联Entity类
 * 设置机构、工作组、岗位等组织对象与角色之间的对应关系
 */
@Entity
@Table(name = "AC_PARTY_ROLE")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class AcPartyRole {

	//属性
	private Long prId;			//主键ID
	private String partyType;	//组织对象类型。机构、岗位、工作组
	private Long partyId;		//组织对象ID
	private Long roleId;		//角色ID

	
	@Id
    @SequenceGenerator(name="SEQ_AC_MODULE", sequenceName="SEQ_AC_MODULE", allocationSize=1)
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_AC_MODULE")
	public Long getPrId() {
		return prId;
	}

	public void setPrId(Long prId) {
		this.prId = prId;
	}

	public String getPartyType() {
		return partyType;
	}

	public void setPartyType(String partyType) {
		this.partyType = partyType;
	}

	public Long getPartyId() {
		return partyId;
	}

	public void setPartyId(Long partyId) {
		this.partyId = partyId;
	}

	public Long getRoleId() {
		return roleId;
	}

	public void setRoleId(Long roleId) {
		this.roleId = roleId;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}